




void paginate(char txtfile[]){

 FILE *file;
 int count = 0;
 int in_buff_size = 80;
 char buff_response[80];
                if ((file = fopen(txtfile, "r")) == NULL){
                printf("There was an error opening the help file\n");
                }       
                //print help file one character at a time
                else{
                        int c;
                        while((c = fgetc(file)) != EOF){
                                printf("%c", c);
								count++;
								
								if(count == 80){
									printf("End of page, press enter to contine to next page.\n");
									sys_req(READ, TERMINAL, buff_response, &in_buff_size);
									//continue printing
									if(*buff_response == '\n'){
										count = 0;
										printf("%c", c);									
									}
									else{
										printf("You didn't press enter. You really should have pressed enter.\n");
									}
								}
                        }
						}
                        printf("\n");
                        //close help file
                        fclose(file);

}